import React from 'react';
import {Navigate} from "react-router-dom";

function AuthComponent(props) {
    return localStorage.getItem('userName')? props.children:<Navigate to={'/login'}/>
}

export default AuthComponent;